﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Microsoft.Windows.UserControls" >

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Microsoft.Windows.UserControls.Wpf;component/Themes/DefaultColors.xaml"/>
        <ResourceDictionary Source="pack://application:,,,/Microsoft.Windows.UserControls.Wpf;component/Themes/Common.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <Thickness x:Key="ImageButtonBorderThickness">1</Thickness>
    <Thickness x:Key="WizardButtonNoBorderThickness">0</Thickness>

    <Style TargetType="{x:Type Button}">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Background" Value="{StaticResource ControlBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlDarkBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource ControlTextBrush}"/>
        <Setter Property="BorderThickness" Value="{StaticResource ImageButtonBorderThickness}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1" />
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"></VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="Cursor">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlCursorMouseHover}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ImageButtonBorderThickness}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentControl" 
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightTextBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="Cursor">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlCursorMouseHover}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HotTrackBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HotTrackBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ImageButtonBorderThickness}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentControl" 
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightTextBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentControl" 
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource InactiveCaptionBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="FocusedVisualElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"></VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border x:Name="PART_Background" 
                                Background="{TemplateBinding Background}" 
                                BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                SnapsToDevicePixels="true"/>
                        <Border x:Name="PART_Content" 
                                Background="{StaticResource ControlBrushTransparent}" 
                                BorderBrush="{StaticResource ControlBrushTransparent}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                SnapsToDevicePixels="true">
                            
                            <ContentControl x:Name="ContentControl" 
                                            Focusable="False" 
                                            Foreground="{TemplateBinding Foreground}" 
                                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                            Margin="{TemplateBinding Padding}" 
                                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">

                                <ContentPresenter x:Name="ContentPresenter" 
                                                          ContentTemplate="{TemplateBinding ContentTemplate}" 
                                                          Content="{TemplateBinding Content}"
                                                          TextElement.Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}" 
                                                          HorizontalAlignment="Center"
                                                          VerticalAlignment="Center"/>
                            </ContentControl>
                        </Border>

                        <Rectangle x:Name="FocusedVisualElement"
                                   SnapsToDevicePixels="true" 
                                   Stroke="{StaticResource ControlDarkDarkBrush}" 
                                   StrokeThickness="1" 
                                   StrokeDashArray="1 2"
                                   Visibility="Collapsed" />

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type local:ImageButton}">
        <Setter Property="Background" Value="{StaticResource ControlBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlDarkBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource ControlTextBrush}"/>
        <Setter Property="BorderThickness" Value="{StaticResource ImageButtonBorderThickness}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1" />
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ImageButton}">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"></VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="Cursor">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlCursorMouseHover}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ImageButtonBorderThickness}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentControl" 
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightTextBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="Cursor">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlCursorMouseHover}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HotTrackBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HotTrackBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ImageButtonBorderThickness}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentControl" 
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightTextBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentControl" 
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource InactiveCaptionBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="FocusedVisualElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"></VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        
                        <Border x:Name="PART_Background" 
                                Background="{TemplateBinding Background}" 
                                BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                SnapsToDevicePixels="true"/>
                        <Border x:Name="PART_Content" 
                                Background="{StaticResource ControlBrushTransparent}" 
                                BorderBrush="{StaticResource ControlBrushTransparent}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                SnapsToDevicePixels="true">
                            <ContentControl x:Name="ContentControl" 
                                            Focusable="False" 
                                            Foreground="{TemplateBinding Foreground}" 
                                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                            Margin="{TemplateBinding Padding}" 
                                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                <Grid>
                                    <Grid x:Name="PART_Vertical"
                                          Margin="6">
                                        <Grid.RowDefinitions>
                                            <RowDefinition x:Name="Row_01" Height="Auto"/>
                                            <RowDefinition x:Name="Row_02" Height="6"/>
                                            <RowDefinition x:Name="Row_03" Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Path Grid.Row="0"
                                              x:Name="Vertical_Path"
                                              Data="{TemplateBinding ImageData}"
                                              Stretch="Uniform" 
                                              Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}"  
                                              Width="18" 
                                              Height="18" 
                                              Margin="0" 
                                              RenderTransformOrigin="0.5,0.5"/>
                                        <ContentPresenter x:Name="Vertical_Content" 
                                                          Grid.Row="2"
                                                          ContentTemplate="{TemplateBinding ContentTemplate}" 
                                                          Content="{TemplateBinding Content}"
                                                          TextElement.Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}" 
                                                          HorizontalAlignment="Center"
                                                          VerticalAlignment="Center"/>
                                    </Grid>
                                    <Grid x:Name="PART_Horizontal"
                                          Margin="6" >
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition x:Name="Column_01" Width="Auto"/>
                                            <ColumnDefinition x:Name="Column_02" Width="6"/>
                                            <ColumnDefinition x:Name="Column_03" Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <Path Grid.Column="0"
                                              x:Name="Horizontal_Path"
                                              Data="{TemplateBinding ImageData}"
                                              Stretch="Uniform" 
                                              Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}"  
                                              Width="18" 
                                              Height="18" 
                                              Margin="0" 
                                              RenderTransformOrigin="0.5,0.5"/>
                                        <ContentPresenter x:Name="Horizontal_Content" 
                                                          Grid.Column="2"
                                                          ContentTemplate="{TemplateBinding ContentTemplate}" 
                                                          Content="{TemplateBinding Content}"
                                                          TextElement.Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}" 
                                                          HorizontalAlignment="Left"
                                                          VerticalAlignment="Center"/>
                                    </Grid>
                                </Grid>
                            </ContentControl>
                        </Border>

                        <Rectangle x:Name="FocusedVisualElement"
                                   SnapsToDevicePixels="true" 
                                   Stroke="{StaticResource ControlDarkDarkBrush}" 
                                   StrokeThickness="1" 
                                   StrokeDashArray="1 2"
                                   Visibility="Collapsed" />

                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Orientation" Value="Horizontal">
                            <Setter TargetName="PART_Vertical" Property="Visibility" Value="Collapsed"/>
                            <Setter Property="MinWidth" Value="99" />
                        </Trigger>
                        <Trigger Property="Orientation" Value="Vertical">
                            <Setter TargetName="PART_Horizontal" Property="Visibility" Value="Collapsed"/>
                            <Setter Property="MinWidth" Value="75" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Orientation" Value="Horizontal" />
                                <Condition Property="ContentType" Value="OnlyContent" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter TargetName="Horizontal_Path" Property="Visibility" Value="Collapsed"/>
                                <Setter TargetName="Horizontal_Content" Property="HorizontalAlignment" Value="Center"/>
                                <Setter TargetName="Column_01" Property="Width" Value="0"/>
                                <Setter TargetName="Column_02" Property="Width" Value="0"/>
                                <Setter Property="MinWidth" Value="75"/>
                            </MultiTrigger.Setters>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Orientation" Value="Horizontal" />
                                <Condition Property="ContentType" Value="OnlyImage" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter TargetName="Horizontal_Content" Property="Visibility" Value="Collapsed"/>
                                <Setter TargetName="Column_02" Property="Width" Value="0"/>
                                <Setter TargetName="Column_03" Property="Width" Value="0"/>
                                <Setter Property="MinWidth" Value="18"/>
                            </MultiTrigger.Setters>
                        </MultiTrigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Orientation" Value="Vertical" />
                                <Condition Property="ContentType" Value="OnlyContent" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter TargetName="Vertical_Path" Property="Visibility" Value="Collapsed"/>
                                <Setter TargetName="Vertical_Content" Property="HorizontalAlignment" Value="Center"/>
                                <Setter TargetName="Row_01" Property="Height" Value="0"/>
                                <Setter TargetName="Row_02" Property="Height" Value="0"/>
                                <Setter Property="MinWidth" Value="75"/>
                            </MultiTrigger.Setters>
                        </MultiTrigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Orientation" Value="Vertical" />
                                <Condition Property="ContentType" Value="OnlyImage" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter TargetName="Vertical_Content" Property="Visibility" Value="Collapsed"/>
                                <Setter TargetName="Row_02" Property="Height" Value="0"/>
                                <Setter TargetName="Row_03" Property="Height" Value="0"/>
                                <Setter Property="MinWidth" Value="18"/>
                            </MultiTrigger.Setters>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type local:WizardButton}" BasedOn="{StaticResource {x:Type local:ImageButton}}">
        <Setter Property="Background" Value="{StaticResource ControlBrushTransparent}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlBrushTransparent}"/>
    </Style>

    <!--<Style TargetType="{x:Type local:WizardButton}">
        <Setter Property="Background" Value="{StaticResource ControlBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource ControlTextBrush}"/>
        <Setter Property="BorderThickness" Value="{StaticResource ControlBorderThickness}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1" />
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:WizardButton}">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"></VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Background" 
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBrushTransparent}" />
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Background" 
                                                                       Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBorderThickness}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="Cursor">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlCursorMouseHover}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentControl" 
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightTextBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Horizontal_Path" 
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightTextBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Vertical_Path" 
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightTextBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Background" 
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBrushTransparent}" />
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Background" 
                                                                       Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBorderThickness}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="Cursor">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlCursorMouseHover}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" 
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HotTrackBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentControl" 
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightTextBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Horizontal_Path" 
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightTextBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Vertical_Path" 
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HighlightTextBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Background" 
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlDarkBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentControl" 
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlDarkBrush}" />
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Horizontal_Path" 
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlDarkBrush}" />
                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Vertical_Path" 
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlDarkBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="FocusedVisualElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"></VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border x:Name="PART_Background" 
                                Background="{TemplateBinding Background}" 
                                BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                SnapsToDevicePixels="true"/>
                        <Border x:Name="PART_Content" 
                                Background="{StaticResource ControlBrushTransparent}" 
                                BorderBrush="{StaticResource ControlBrushTransparent}" 
                                BorderThickness="{StaticResource ControlWithoutBorderThickness}" 
                                SnapsToDevicePixels="true">
                            <ContentControl x:Name="ContentControl" 
                                            Focusable="False" 
                                            Foreground="{TemplateBinding Foreground}" 
                                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                            Margin="{TemplateBinding Padding}" 
                                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                <Grid>
                                    <Grid x:Name="PART_Vertical"
                                          Margin="6">
                                        <Grid.RowDefinitions>
                                            <RowDefinition x:Name="Row_01" Height="Auto"/>
                                            <RowDefinition x:Name="Row_02" Height="6"/>
                                            <RowDefinition x:Name="Row_03" Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Path Grid.Row="0"
                                              x:Name="Vertical_Path"
                                              Data="{TemplateBinding Data}"
                                              Stretch="Uniform" 
                                              Fill="{TemplateBinding Foreground}" 
                                              Width="18" 
                                              Height="18" 
                                              Margin="0" 
                                              RenderTransformOrigin="0.5,0.5"/>
                                        <ContentPresenter x:Name="Vertical_Content" 
                                                          Grid.Row="2"
                                                          ContentTemplate="{TemplateBinding ContentTemplate}" 
                                                          Content="{TemplateBinding Content}"
                                                          TextElement.Foreground="{TemplateBinding Foreground}" 
                                                          HorizontalAlignment="Center"
                                                          VerticalAlignment="Center"/>
                                    </Grid>
                                    <Grid x:Name="PART_Horizontal"
                                          Margin="6" >
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition x:Name="Column_01" Width="Auto"/>
                                            <ColumnDefinition x:Name="Column_02" Width="6"/>
                                            <ColumnDefinition x:Name="Column_03" Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <Path Grid.Column="0"
                                              x:Name="Horizontal_Path"
                                              Data="{TemplateBinding Data}"
                                              Stretch="Uniform" 
                                              Fill="{TemplateBinding Foreground}" 
                                              Width="18" 
                                              Height="18" 
                                              Margin="0" 
                                              RenderTransformOrigin="0.5,0.5"/>
                                        <ContentPresenter x:Name="Horizontal_Content" 
                                                          Grid.Column="2"
                                                          ContentTemplate="{TemplateBinding ContentTemplate}" 
                                                          Content="{TemplateBinding Content}"
                                                          TextElement.Foreground="{TemplateBinding Foreground}" 
                                                          HorizontalAlignment="Left"
                                                          VerticalAlignment="Center"/>
                                    </Grid>
                                </Grid>
                            </ContentControl>
                        </Border>

                        <Rectangle x:Name="FocusedVisualElement"
                                   SnapsToDevicePixels="true" 
                                   Stroke="{StaticResource ControlDarkDarkBrush}" 
                                   StrokeThickness="1" 
                                   StrokeDashArray="1 2"
                                   Visibility="Collapsed" />

                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Orientation" Value="Horizontal">
                            <Setter TargetName="PART_Vertical" Property="Visibility" Value="Collapsed"/>
                            <Setter Property="MinWidth" Value="99" />
                        </Trigger>
                        <Trigger Property="Orientation" Value="Vertical">
                            <Setter TargetName="PART_Horizontal" Property="Visibility" Value="Collapsed"/>
                            <Setter Property="MinWidth" Value="75" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Orientation" Value="Horizontal" />
                                <Condition Property="ShowData" Value="False" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter TargetName="Horizontal_Path" Property="Visibility" Value="Collapsed"/>
                                <Setter TargetName="Horizontal_Content" Property="HorizontalAlignment" Value="Center"/>
                                <Setter TargetName="Column_01" Property="Width" Value="0"/>
                                <Setter TargetName="Column_02" Property="Width" Value="0"/>
                                <Setter Property="MinWidth" Value="75"/>
                            </MultiTrigger.Setters>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Orientation" Value="Horizontal" />
                                <Condition Property="ShowText" Value="False" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter TargetName="Horizontal_Content" Property="Visibility" Value="Collapsed"/>
                                <Setter TargetName="Column_02" Property="Width" Value="0"/>
                                <Setter TargetName="Column_03" Property="Width" Value="0"/>
                                <Setter Property="MinWidth" Value="18"/>
                            </MultiTrigger.Setters>
                        </MultiTrigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Orientation" Value="Vertical" />
                                <Condition Property="ShowData" Value="False" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter TargetName="Vertical_Path" Property="Visibility" Value="Collapsed"/>
                                <Setter TargetName="Vertical_Content" Property="HorizontalAlignment" Value="Center"/>
                                <Setter TargetName="Row_01" Property="Height" Value="0"/>
                                <Setter TargetName="Row_02" Property="Height" Value="0"/>
                                <Setter Property="MinWidth" Value="75"/>
                            </MultiTrigger.Setters>
                        </MultiTrigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Orientation" Value="Vertical" />
                                <Condition Property="ShowText" Value="False" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter TargetName="Vertical_Content" Property="Visibility" Value="Collapsed"/>
                                <Setter TargetName="Row_02" Property="Height" Value="0"/>
                                <Setter TargetName="Row_03" Property="Height" Value="0"/>
                                <Setter Property="MinWidth" Value="18"/>
                            </MultiTrigger.Setters>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>-->
</ResourceDictionary>